package com.gudaomai.wuye.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.gudaomai.wuye.entity.Car;
import com.gudaomai.wuye.mapper.CarMapper;
import com.gudaomai.wuye.service.ICarServ;
import com.gudaomai.wuye.service.impl.BaseServiceImpl;

import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zenghualu
 * @since 2017-09-01
 */
@Service
public class CarServImp extends BaseServiceImpl<CarMapper, Car> implements ICarServ {

	// 根据车牌号判断是否存在
	@Override
	public boolean isExist(String plate) {
		
		EntityWrapper<Car> ew=new EntityWrapper<>();
		ew.setEntity(new Car());
		ew.eq("plate", plate);
		
		Car car = this.selectOne(ew);
		
		if (null == car) {
			return false;
		}
		
		return true;
	}

}
